[20250321] BOJ / G4 / Jigsaw of Shadows / 권혁준 #280
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/33144
🧭 풀이 시간
18분

👀 체감 난이도
✏️ 문제 설명
사람 N명이 평지에 서있고, 빛이 지면과 이루는 각도가$theta$ 이다.
사람들 그림자 길이의 총 합을 구해보자.
🔍 풀이 방법
[사용한 알고리즘]
사람들을 위치 기준으로 정렬시켜놓고 왼쪽 사람부터 스위핑하며 그림자의 길이를 구한다.
삼각함수로 간단하게 구할 수 있었고, 겹치는 부분에 대한 처리를 조심하며 구현했다.
⏳ 회고
자바로 푸니까 시간 초과가 떴다.
코드 그대로 C++로 옮기니까 맞았다.